package com.anolesoft.yr.mbus.contm.entity;

import com.anolesoft.yr.mbus.contm.dto.ContmBaseClauseDto;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.checkerframework.checker.units.qual.C;

/**
 * 合同基础条款表
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "contm_base_clause")
public class ContmBaseClause implements Serializable {
    public static final String COL_OBJUID = "objuid";
    public static final String COL_PAGE_TYPE = "page_type";
    public static final String COL_ITEM_TYPE = "item_type";
    public static final String COL_ORDER_CODE = "order_code";
    public static final String COL_PARENT_UID = "parent_uid";
    public static final String COL_CONTENT = "content";
    public static final String COL_CONT_TYPE = "cont_type";
    public static final String COL_C_USER_UID = "c_user_uid";
    public static final String COL_C_TIME = "c_time";
    public static final String COL_ALIAS = "alias";


    /**
     * 主键
     */
    @TableId(value = "objuid")
    private String objuid;

    /**
     * 页类别
     */
    @TableField(value = "page_type")
    private String pageType;

    /**
     * 类型
     */
    @TableField(value = "item_type")
    private String itemType;

    /**
     * 序号
     */
    @TableField(value = "order_code")
    private Byte orderCode;

    /**
     * 父级
     */
    @TableField(value = "parent_uid")
    private String parentUid;

    /**
     * 内容
     */
    @TableField(value = "content")
    private String content;

    /**
     * 条款表主键
     */
    @TableField(value = "cont_base_main_uid")
    private String contBaseMainUid;

    /**
     * 创建人
     */
    @TableField(value = "c_user_uid")
    private String cUserUid;

    /**
     * 创建时间
     */
    @TableField(value = "c_time")
    private Date cTime;

    @TableField(value = "alias")
    private String alias;

    private static final long serialVersionUID = 1L;

    @TableField(exist = false)
    private List<ContmBaseClause> contmBaseClauses;
    @TableField(exist = false)
    private List<ContmBaseClause> titleObj;
    @TableField(exist = false)

    private ContmBaseClause  contentObj;

    public ContmBaseClauseDto toContmBaseClauseDto(){
        return ContmBaseClauseDto.builder().id(objuid).title(content).pId(parentUid).ppId(parentUid).name(alias).type(itemType).pageType(pageType).build();
    }



}